package com.tedu.controller;

import com.tedu.Common.enumerator.ServiceCode;
import com.tedu.Common.web.JsonResult;
import com.tedu.pojo.entity.Trip;
import com.tedu.pojo.param.TripParam;
import com.tedu.pojo.vo.TripVo;
import com.tedu.service.ITripService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.Range;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/trip")
@Api(tags = "旅游模块")
public class TripController {
    @Autowired
    private ITripService service;



    @GetMapping("/select-by-economize-id/{id:[0-9]+}")
    @ApiOperation("查询旅游方案通过省")
    public JsonResult selectTripByEconomizeId(@PathVariable @Range(min = 1, message = "请提交有效的商品ID值！") int id) {
        List<TripVo> tripVos = service.selectTripById(id);
        return JsonResult.ok(tripVos);
    }
    @GetMapping("/select-by-city-id/{id:[0-9]+}")
    @ApiOperation("查询旅游方案通过城市")
    public JsonResult selectTripByCityId(@PathVariable @Range(min = 1, message = "请提交有效的商品ID值！") int id) {
        List<TripVo> tripVos = service.selectTripById(id);
        return JsonResult.ok(tripVos);
    }


}
